deep copy empty attributes#714
Merged
codeboten merged 4 commits intoopen-telemetry:masterfrom May 27, 2020
Merged
Conversation
sjbrunst
approved these changes
May 20, 2020
toumorokoshi
suggested changes
May 21, 2020
Member
toumorokoshi
left a comment
There was a problem hiding this comment.
I agree that this approach will fix the issue.
One fix and I think it's good to merge: can you create utility methods rather than have parameterized creation? It's pretty easy to pass the wrong variable and create the wrong object.
I'd suggest public utility methods around empty_{attributes,events,links}.
0e4a3f1 to
dadad68
Compare
toumorokoshi
approved these changes
May 27, 2020
Member
toumorokoshi
left a comment
There was a problem hiding this comment.
thanks! I'm not sure that these attributes being protected is the right approach, but until we find a need to create such empty sets outside of the constructor, I think we're ok.
codeboten
suggested changes
May 27, 2020
Contributor
codeboten
left a comment
There was a problem hiding this comment.
Can you add a note to the sdk changelog, i'll approve and merge afterwards
6d371c3 to
e35b7ca
Compare
6 tasks
srikanthccv
pushed a commit
to srikanthccv/opentelemetry-python
that referenced
this pull request
Nov 1, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #713. Previously it was possible for a user (acting against the api) to mutate a default variable. Deepcopying solves this issue.